const xhr = new XMLHttpRequest();
xhr.open('GET', 'data.json', true);
xhr.onload = function() {
  if (this.status === 200) {
    const data = JSON.parse(this.response);
    console.log(data);
  }
};
xhr.send();